package com.campus.common.bean.common;

import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * 分页工具类
 */
public class PageUtil {
    public static <T> PageInfo<T> convertPageInfo(PageInfo pageInfo, List<T> list) {
        PageInfo<T> result = new PageInfo<>();
        result.setPageNum(pageInfo.getPageNum());
        result.setPageSize(pageInfo.getPageSize());
        result.setTotal(pageInfo.getTotal());
        result.setPages(pageInfo.getPages());
        result.setList(list);
        return result;
    }
}
